package ddz;

import java.util.*;

public class mei5 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] a = new int[n];
        int[] b = new int[n];
        int[] c = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
        }
        for (int i = 0; i < n; i++) {
            b[i] = sc.nextInt();
        }
        for (int i = 0; i < n; i++) {
            c[i] = sc.nextInt();
        }
        int ans = 0;
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                for (int k = 0; k < n; k++) {
                    if(a[i] < b[j] && a[i] * 2 >= b[j] && c[k] > b[j] && b[j] * 2 >= c[k])
                        ans++;
                }
            }
        }
        System.out.println(ans);
    }
}
/*
3
2 7 2
1 5 3
4 6 3
 */